# -*- coding: utf-8 -*-
from google.appengine.ext import db

class Pic(db.Model):
    pic = db.BlobProperty(required=True)
    aid = db.StringProperty(required=True)
    size = db.StringProperty(required=True, default="l")
    date = db.DateTimeProperty(auto_now_add=True)

    def get_absolute_url(self):
        return ('myapp.views.download_file', (), {'key': self.key(),
                                                  'name': self.name})

    def __unicode__(self):
        return u'%s' % self.aid
